package com.lp.dao;

import com.lp.po.PagingVO;
import com.lp.po.Student;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface StudentDao {
    int count();
    int countByName(String username);
    //查询所有用户
    List<Student> findAll(PagingVO pagingVO);
    //名字模糊查询
    List<Student> findByName(@Param("toPageNo")Integer toPageNo,@Param("pageSize")Integer pageSize ,@Param("username") String username);
    //根据id找用户
    Student findById(Integer userid);
    //根据id删除用户
    int deleteByPrimaryKey(Integer userid);
    //根据id修改用户
    int updateByPrimaryKey(Student userid);
    //注册成功后添加到用户表中
    void inset(Student student);
    int findIdByUsername(String username);
    void updateWithPassword(@Param("username")String username,@Param("password") String password);

    /*用户身份控制方法*/
    Student findself(String username);

    Student selectName(String username);



    /*小程序模块*/
    List<Student> wxfindUserBytelnumber(@Param("telnumber") String telnumber, @Param("password") String password);
    List<Student> wxfindUserByusername(@Param("username") String username, @Param("password") String password);

    List<Student> wxfindById(Integer userid);
    int wxRegisterStudent(@Param("username")String username, @Param("telnumber")String telnumber, @Param("password")String password, @Param("grade")Date grade);
    List<Student> wxfindCollegeNameWithUserid(Integer collegeid);
}